﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DelonixRegiaHMSys.Core.Services;
using DelonixRegiaHMSys.Infrastructure.Data;

namespace DelonixRegiaHMSys.UI.WebForms
{
    public partial class RoomReservation : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
           
                lblguestID.Text = Request.QueryString["Guest ID"];
          
        }

        protected void btnrrnext_Click(object sender, EventArgs e)
        {
            string ReservationID = lblreservationID.Text;
            string GuestID = lblguestID.Text;
            string UserID = ddluserID.SelectedValue;
            int NumberOfAdults = Convert.ToInt32(ddlnumOfAdults.SelectedValue);
             int NumberOfChildren = Convert.ToInt32(ddlnumOfChildren.SelectedValue);
            DateTime ArrivalDateTime = Convert.ToDateTime(tbxtime.Text);
            string RoomType = cblroomType.SelectedValue;
            string BedType = rblbedType.SelectedValue;
            string SmokingOrNot = rblsmokingOrNot.SelectedValue;
            string AddRemarks = tbxaddremarks.Text;
            string ReservationStatus = lblreservationStatus.Text;

            var rrservice = new rrServices(new EfRoomReservationQuery());
            rrservice.AddRoomReservation(ReservationID, GuestID, UserID, NumberOfAdults, NumberOfChildren, ArrivalDateTime, RoomType, BedType, SmokingOrNot, AddRemarks, ReservationStatus);
            Response.Redirect("~/WebForms/RetrieveRoomReservation.aspx", true);
        }
    }
}